/**
 * There are <a href="https://github.com/thinkgem/jeesite">JeeSite</a> code generation
 */
package com.chlitina.store.modules.base.entity;

import javax.persistence.CascadeType;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.Id;
import javax.persistence.IdClass;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.validation.constraints.NotNull;

import org.hibernate.annotations.Cache;
import org.hibernate.annotations.CacheConcurrencyStrategy;
import org.hibernate.annotations.NotFound;
import org.hibernate.annotations.NotFoundAction;

import com.chlitina.store.common.persistence.BaseEntity;

/**
 * 产品充值卡模板产品Entity
 * @author liujiang
 * @version 2013-11-03
 */
@Entity
@Table(name = "store_card_template_product_detail")
@IdClass(StoreCardTemplateProductDetailPK.class)
@Cache(usage = CacheConcurrencyStrategy.READ_WRITE)
public class StoreCardTemplateProductDetail extends BaseEntity {
	
	private static final long serialVersionUID = 1L;
	private StoreCardTemplateProduct storeCardTemplateProduct;//产品充值卡模板
	private StoreProduct storeProduct; 	// 店面产品

	public StoreCardTemplateProductDetail() {
	}

	@Id
	@ManyToOne(cascade={CascadeType.REFRESH},fetch = FetchType.LAZY)
	@JoinColumn(name="SCTP_ID")
	@NotFound(action = NotFoundAction.IGNORE)
	@Cache(usage = CacheConcurrencyStrategy.READ_WRITE)
	@NotNull
	public StoreCardTemplateProduct getStoreCardTemplateProduct() {
		return storeCardTemplateProduct;
	}

	public void setStoreCardTemplateProduct(
			StoreCardTemplateProduct storeCardTemplateProduct) {
		this.storeCardTemplateProduct = storeCardTemplateProduct;
	}

	@Id
	@ManyToOne(cascade={CascadeType.REFRESH},fetch = FetchType.LAZY)
	@JoinColumn(name="PRODUCT_ID")
	@NotFound(action = NotFoundAction.IGNORE)
	@Cache(usage = CacheConcurrencyStrategy.READ_WRITE)
	@NotNull
	public StoreProduct getStoreProduct() {
		return storeProduct;
	}

	public void setStoreProduct(StoreProduct storeProduct) {
		this.storeProduct = storeProduct;
	}
}


